package com.spring.demo.spring.core.applicationprocess.service;

import com.spring.demo.spring.core.annoation.Autowartied;
import com.spring.demo.spring.core.annoation.ComponentFree;
import com.spring.demo.spring.core.annoation.Scope;
import com.spring.demo.spring.core.context.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @Author RenPu
 * @Date 2024/2/15 21:29
 * @Version 1.0
 * @Description:
 **/

@ComponentFree("userService")
@Scope
public class UserService implements InitializingBean,UserInterface {

    @Autowartied
    private OrderService orderService;


    @Override
    public void userServiceTest(){

        System.out.println("userService is used ============"+this);
    }

    @Override
    public String toString() {
        return "UserService{" +
                "orderService=" + orderService +
                '}';
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("userService中的 InitializingBean methond 被触发了==========");
    }
}
